<?php

namespace app\models;

use yii\base\Model;

class UserForm extends Model
{
    public $name;
    public $email;

    public function rules() //验证规则
    {
        return [
            [['name', 'email'], 'required'], //这两个必填
            ['email', 'email'],  //这个要符合邮箱格式
        ];
    }
}